Website Summary Files Commits Branches @commit @diff @stats
path: root / Sem. 02 / isPrime_between[1,9].cpp
blob: 08d84454b36ee79b5cfe6c3e61b541255a8242d4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26

#include <iostream>
using namespace std;

int main()
{
	int num;
	cin >> num;

	switch (num)
	{
	case 2:
	case 3:
	case 5:
	case 7:cout << "Prime" << endl; break;

	case 1:
	case 4:
	case 6:
	case 8:
	case 9:cout << "Not a prime" << endl; break;

	default: cout << "The number is not between 1 and 10" << endl; break;
	}

}